using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Exchange_order_PassengerMap : EntityTypeConfiguration<Exchange_order_Passenger>
    {
        public Exchange_order_PassengerMap()
        {
            // Primary Key
            this.HasKey(t => new { t.XOID, t.PASSENGERNAME });

            // Properties
            this.Property(t => t.XOID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.PASSENGERNAME)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Exchange_order_Passenger");
            this.Property(t => t.XOID).HasColumnName("XOID");
            this.Property(t => t.PASSENGERNAME).HasColumnName("PASSENGERNAME");
        }
    }
}
